﻿<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
    <head>
        <title>意见类型列表 - 后台管理 - smoothly</title>
        <!-- 引入网站头部 -->
        <div th:replace="~{include/all_include::title}"/>

    </head>
    <body>
        <!-- body的标题栏 -->
        <nav class="breadcrumb">
            <i class="Hui-iconfont">&#xe67f;</i> 首页
            <span class="c-gray en">&gt;</span> 意见管理
            <span class="c-gray en">&gt;</span> 意见类型管理
            <a class="btn btn-success radius r btn-refresh" style="line-height:1.6em;margin-top:3px"
               href="javascript:location.replace(location.href);" title="刷新">
                <i class="Hui-iconfont">&#xe68f;</i>
            </a>
        </nav>
        <!-- 内容 -->
        <div class="page-container">
            <form th:action="@{/back/opinion/opinionTypeList}" method="post">
                <div class="text-c">
                    关键字:
                    <input type="text" class="input-text" style="width:250px" placeholder="输入关键字" id="keyword" name="keyword" th:value="${keyword}">
                    状态:
                    <span class="select-box inline">
                        <select name="status" class="select">
                            <option value="">请选择</option>
                            <option value="1" th:selected="${status == '1'}">启用</option>
                            <option value="0" th:selected="${status == '0'}">禁用</option>
                        </select>
                    </span>
                    日期范围：
                    <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="datemin"
                           readonly name="st"
                           th:value="${st}"
                           class="input-text Wdate" style="width:170px;">
                    -
                    <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="datemax"
                           readonly name="ed"
                           th:value="${ed}"
                           class="input-text Wdate" style="width:170px;">
                    <button type="submit" class="btn btn-success radius" id="" name="">
                        <i class="Hui-iconfont">&#xe665;</i>
                        搜索
                    </button>
                </div>
            </form>
            <div class="cl pd-5 bg-1 bk-gray mt-20">
                <span class="l">
                    <a href="javascript:;" onclick="page_add('添加意见类型','back/opinion/opinionTypeInsert','','510')"
                        class="btn btn-primary radius">
                        <i class="Hui-iconfont">&#xe600;</i> 添加
                    </a>
                </span>
                <span class="r">共有数据：<strong th:text="${response?.data?.pageInfoUtil?.totalRecord}"></strong>条</span>
            </div>
            <div class="mt-20">
                <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">
                    <table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
                        <thead>
                            <tr class="text-c">
                                <th width="110">Id</th>
                                <th width="80">名称</th>
                                <th width="50">状态</th>
                                <th width="110">创建时间</th>
                                <th width="110">更新时间</th>
                                <th width="110">发布时间</th>
                                <th width="50">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr class="text-c" th:each="one : ${response?.data?.list}">
                                <td th:text="${one.id}"></td>
                                <td>
                                    <a href="javascript:;" th:title="'查看意见类型详情-'+${one.name}" th:data-title="'查看意见类型详情-'+${one.name}"
                                       th:data-href="@{/back/opinion/opinionTypeUpdate(id=${one?.id})}"
                                       onclick="Hui_admin_tab(this)"
                                       th:text="${#strings.abbreviate(one.name,10)}" class="href_info"></a>
                                </td>
                                <td class="td-status">
                                    <span class="label label-success radius" th:text="${one.statusStr}">已启用</span>
                                </td>
                                <td th:text="${one.createTime}"></td>
                                <td th:text="${one.updateTime}"></td>
                                <td th:text="${one.pubTime}"></td>
                                <td class="td-manage">
                                    <a title="编辑" href="javascript:;" th:onclick="page_edit('编辑','back/opinion/opinionTypeUpdate?operType=update',[[${one.id}]])"
                                       class="ml-5" style="text-decoration:none">
                                        <i class="Hui-iconfont">&#xe6df;</i>
                                    </a>
                                </td>
                            </tr>
                        </tbody>
                    </table>

                    <form th:action="@{/back/opinion/opinionTypeList}" method="post" id="pageForm">
                        <input type="hidden" name="keyword" th:value="${keyword}">
                        <input type="hidden" name="status" th:value="${status}">
                        <input type="hidden" name="opType" th:value="${opType}">
                        <input type="hidden" name="st" th:value="${st}">
                        <input type="hidden" name="ed" th:value="${ed}">

                        <div class="dataTables_info" id="DataTables_Table_0_info"
                             role="status" aria-live="polite">
                            共<span th:text="${response?.data?.pageInfoUtil?.totalRecord}"></span>条,共<span th:text="${response?.data?.pageInfoUtil?.totalPage}"></span>页
                        </div>
                        <div class="dataTables_paginate paging_simple_numbers"
                             id="DataTables_Table_0_paginate">
                            <a class="paginate_button previous disabled"
                               aria-controls="DataTables_Table_0" data-dt-idx="0" tabindex="0"
                               th:onclick="return pageFormSubmit('pageForm','current','1','size',[[${response?.data?.pageInfoUtil?.pageSize}]])"
                               id="DataTables_Table_0_previous">
                                首页
                            </a>
                            <a class="paginate_button previous disabled"
                               aria-controls="DataTables_Table_0" data-dt-idx="0" tabindex="0"
                               th:onclick="return pageFormSubmit('pageForm', 'current', '[[${response?.data?.pageInfoUtil?.prePage}]]', 'size',[[${response?.data?.pageInfoUtil?.pageSize}]])"
                               id="DataTables_Table_0_previous">
                                上一页
                            </a>
                            <a class="paginate_button next disabled"
                               aria-controls="DataTables_Table_0" data-dt-idx="2" tabindex="0"
                               th:onclick="return pageFormSubmit('pageForm', 'current', '[[${response?.data?.pageInfoUtil?.nextPage}]]', 'size',[[${response?.data?.pageInfoUtil?.pageSize}]])"
                               id="DataTables_Table_0_next">
                                下一页
                            </a>
                            <a class="paginate_button next disabled"
                               aria-controls="DataTables_Table_0" data-dt-idx="2" tabindex="0"
                               th:onclick="return pageFormSubmit('pageForm', 'current', '[[${response?.data?.pageInfoUtil?.totalPage}]]', 'size',[[${response?.data?.pageInfoUtil?.pageSize}]])"
                               id="DataTables_Table_0_next">
                                尾页
                            </a>
                            第<input type="text" class="paginate_button" id="current" name="currentPage" th:value="${response?.data?.pageInfoUtil?.currentPage}" size="5" maxlength="5">页
                            每页<input type="text" class="paginate_button" id="size" name="pageSize" th:value="${response?.data?.pageInfoUtil?.pageSize}" size="5" maxlength="5">条
                            <input type="submit" value="GO" class="paginate_button">
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!-- 引入公共的头部 -->
        <div th:replace="~{include/all_include::footer}"></div>
        <script type="text/javascript" th:inline="javascript">
            /* js中获取的项目根路径 */
            var rootPath = [[@{/}]];
            $(function () {
                $('.table-sort').dataTable({
                    "aaSorting": [],//默认第几个排序
                    "bStateSave": true,//状态保存
                    "paging" : false,
                    "info":false,
                    "aoColumnDefs": [
                        //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
                        {"orderable": false, "aTargets": [0, 8, 9]}// 制定列不参与排序
                    ]
                });
            });
            /*用户-添加*/
            function page_add(title, url, w, h) {
                var index = layer.open({
                    type: 2,
                    title: title,
                    content: rootPath + url
                });
                layer.full(index);
            }

            /*用户-查看*/
            function page_show(title, url, id, w, h) {
                layer_show(title, url, w, h);
            }
            /*用户-编辑*/
            function page_edit(title, url, id) {
                var index = layer.open({
                    type: 2,
                    title: title,
                    content: rootPath + url + "&id=" + id
                });
                layer.full(index);
                return false;
            }

            /*
				批量操作切换
			*/
            function batchSwitch(selId)
            {
                var selVal = $("#" + selId).val();
                /* 所有的选择信息都隐藏掉 */
                $(".selectInfo").hide();

                if('updateStatus' == selVal)
                {
                    $("#" + selVal).show();
                }
            }
        </script>
    </body>
</html>